package jee.boot.common.rest;

import jee.boot.common.basic.CrudController;
import jee.boot.common.basic.result.ResponseMessage;
import jee.boot.common.basic.result.Result;
import jee.boot.common.service.SystemConfigService;
import jee.boot.entity.system.SystemConfig;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统配置信息
 */
@RestController
@RequestMapping("/config")
public class SystemConfigRestController extends CrudController<SystemConfigService, SystemConfig> {

    /**
     * 查看
     *
     * @param entity
     * @return
     */
    @PostMapping("/getByCode")
    public ResponseMessage<SystemConfig> get(@RequestBody SystemConfig entity) {
        SystemConfig data = service.getByCode(entity);
        return Result.success(data);
    }
}
